import request from "@/utils/request";

/**
 * 工序任务-分页查询
 */
export const pageReportExecuteProcessTaskApi = (data) => {
  return request({
    url: "/api/report/task/v1/page",
    method: "get",
    params: data,
  });
};

/**
 * 工序任务-详情查询
 */
export const getReportExecuteProcessTaskDetailsApi = (id) => {
  return request({
    url: `/api/report/task/v1/details/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-确认操作
 */
export const confirmReportProcessTaskApi = (id) => {
  return request({
    url: `/api/report/task/v1/confirm/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-开工
 */
export const startReportProcessTaskApi = (id) => {
  return request({
    url: `/api/report/task/v1/start/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-暂停
 */
export const suspendReportProcessTaskApi = (id) => {
  return request({
    url: `/api/report/task/v1/suspend/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-完工
 */
export const finishReportProcessTaskApi = (id) => {
  return request({
    url: `/api/report/task/v1/finish/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-接收
 */
export const acceptReportProcessTaskApi = (data) => {
  return request({
    url: `/api/report/task/v1/accept`,
    method: "post",
    data
  });
};

/**
 * 工序任务-委外转出
 */
export const outsourcingProcessTaskApi = (data) => {
  return request({
    url: `/api/process/task/v1/outsourcing/out`,
    method: "post",
    data
  });
};



export const getQueryTransferApi = (id) => {
  return request({
    url: '/api/process/task/v1/query/transfer/'+id,
    method: 'get'
  });
};

export const getQueryTransferOutApi = (id) => {
  return request({
    url: '/api/process/task/v1/query/out/transfer/'+id,
    method: 'get'
  });
};

/**
 * 工序任务-领料
 */
export const pickingReportProcessTaskApi = (data) => {
  return request({
    url: `/api/report/task/v1/picking`,
    method: "post",
    data
  });
};

export const getQueryPickApi = (id) => {
  return request({
    url: '/api/process/task/v1/query/pick/'+id,
    method: 'get'
  });
};


/**
 * 工序任务-首检
 */
export const firstReportInspectionProcessTaskApi = (id) => {
  return request({
    url: `/api/report/task/v1/firstInspect/${id}`,
    method: "get",
  });
};

/**
 * 工序任务-报工
 */
export const reportTaskApi = (data) => {
  return request({
    url: `/api/report/task/v1/report`,
    method: "get",
    params: data
  });
};
